//
// C++ Interface: toolbar
//
// Description: 
//
//
// Author: Os3 s.r.l. <xgui@os3.it>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

namespace xgui
{
	class Image;

    %feature("docstring","derives from :class:`xgui.WidgetClass` ") ToolbarClass;
	struct ToolbarClass : public xgui::WidgetClass
	{
		ToolbarClass();
		std::string const &className();
		bool isInstanceable();
		xgui::Object * create(xgui::Object * parent, xgui::StringMap &properties);

		virtual bool canContain(xgui::ClassInfo * c);
	};

    %feature("docstring","derives from :class:`xgui.Widget` \n\n**PROPERTIES**\n\n* **style** *(RW):* sets or retrieves the toolbar style. It can be one of the following values:\n\n * *\"icons\"* -> only icons are displayed on toolbar buttons (no text is displayed,if a button does not have a tooltip text then the text is displayed as a tooltip)\n\n * *\"text\"*	-> only text is displayed on toolbar buttons (no image is displayed)\n\n * *\"both\"* -> both icons and text are displayed on toolbar buttons. default: \"both\"\n\n**EVENTS**\n\n* **onclick** *(linked to* :class:`xgui.TextStatusCallback` *):* fired when the user clicks on a toolbar button. the string parameter of the callback function is the name of the clicked toolbar button. The status parameter is set to *1* if the clicked button has been checked, otherwise is set to *0*.\n\n**METHODS**\n\n") Toolbar;
	class Toolbar : public xgui::Widget
	{
		protected:
			Toolbar(xgui::Container * parent, xgui::ClassInfo * cinfo, xguimpl::Toolbar * widget);
			virtual ~Toolbar();

		public:	
		    %feature("docstring","\n\nadds a new toolbar item. <id> specifies the id of the element to be added, <text> is the text displayed on the item when the toolbar has a style that displays text, <icon> is the image to show when the toolbar has a style that displays images and <tooltip> is the tooltip to show for the item. <type> can be an empty string for a standard toolbar button or any  of the following values:\n\n * *\"separator\"* -> creates an empty space\n\n * *\"check\"* -> creates a checkable button\n\n * *\"radio_begin\"* -> pseudo-item that specifies the beginning of a radio group\n\n * *\"radio_end\"* -> pseudo-item that specifies the end of a radio group\n\n") addItem;
			int addItem ( std::string const &id, std::string const &text, xgui::Image * icon, std::string const &tooltip, std::string const & type = "" );
			%feature("docstring","removes the specified item from the toolbar.\n\n*C++*::\n\n int delItem ( const std::string & name );\n\n") delItem;
			int delItem ( const std::string & name );

            %feature("docstring","enables the specified toolbar button (the button can be clicked)\n\n*C++*::\n\n void enableButton ( const std::string & name );\n\n") enableButton;
			void enableButton ( const std::string & name );
			%feature("docstring","disables the specified toolbar button (the button can't be clicked and is grayed)\n\n*C++*::\n\n void disableButton ( const std::string & name );\n\n") disableButton;
			void disableButton ( const std::string & name );
			%feature("docstring","puts the specified checkable toolbar button in the \"checked\" state.\n\n*C++*::\n\n void checkButton ( const std::string & name );\n\n") checkButton;
			void checkButton ( const std::string & name );
			%feature("docstring","puts the specified checkable toolbar button in the \"unchecked\" state.\n\n*C++*::\n\n void uncheckButton ( const std::string & name );\n\n") uncheckButton;
			void uncheckButton ( const std::string & name );
			%feature("docstring","returns true if the specified checkable toolbar button is in the \"checked\" state.\n\n*C++*::\n\n bool isButtonChecked ( const std::string & name );\n\n") isButtonChecked;
			bool isButtonChecked ( const std::string & name );
	};
}

%extend xgui::Toolbar {
	%pythoncode {
		def __del__(self):
			if self.valid: self.delPyOwner(self)
	}
}

